//
//  TGPlanRecommendHeadCollectionViewCell.m
//  WanCaiC8
//
//  Created by QiuXun on 2019/1/22.
//  Copyright © 2019 tangang. All rights reserved.
//

#import "TGPlanRecommendHeadCollectionViewCell.h"
#import "PlanRecommendHeadView.h"
#import "NewPlanLotteryVC.h"
@interface TGPlanRecommendHeadCollectionViewCell()
@property(nonatomic,strong) PlanRecommendHeadView *headView;
@end
@implementation TGPlanRecommendHeadCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    
    
    self.headView=[[PlanRecommendHeadView alloc] initWithType:LotteryNumTypeLottery];
    self.headView.lType=@"5";
    
    WS(weakSelf);
    self.headView.lookNewBlock = ^(NSString *newNum) {
        
        
        if ([UserModel userModel].UserId.length>0) {
            NewPlanLotteryVC *vc=[[NewPlanLotteryVC alloc]init];
            LotteryTypeModel *model = [[LotteryTypeModel alloc] init];
            model.lType =@"5";
            model.Name = @"六合彩";
            vc.lotteryTypeModel=model;
            [[TGTools viewController:weakSelf].navigationController pushViewController:vc animated:YES];
        }else{
            [[BaseVM manage] login];
        }
    };
    
    [self.contentView addSubview:self.headView];
    
    [self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 0, 5, 0));
    }];
    
}


-(void)dealloc{
    
    [self.headView cancleTimer];
    
}





@end
